package cl.rizepe.playntest.core.menu;

import pythagoras.f.Point;

public class MenuOriginGrid9 implements MenuOrigin {
	protected Point center;
	protected Point buttonSize;
	protected Point menuOrigin;
	protected int location;
	
	public Point getCenter() {
		return center;
	}

	public void setCenter(Point center) {
		this.center = center;
	}

	public Point getButtonSize() {
		return buttonSize;
	}

	public void setButtonSize(Point buttonSize) {
		this.buttonSize = buttonSize;
	}

	public int getLocation() {
		return location;
	}

	public void setLocation(int location) {
		this.location = location;
	}

	
	
	
	public MenuOriginGrid9(Point center, Point buttonSize, int location){
		this.center=center;
		this.buttonSize=buttonSize;
		this.location=location;
		menuOrigin=getMenuOrigin();
		
	}
	
	@Override
	public Point getMenuOrigin() {
		float x= center.x()+((location-1)%3-1.5f)*buttonSize.x();

		float y= center.y()+((location-1)/3-1.5f)*buttonSize.y();
		
		return new Point(x,y);
	}

}
